package cn.hx.whh.automaticticket.entity;


import com.alibaba.fastjson.JSONObject;

import java.io.Serializable;

import cn.hx.whh.automaticticket.params.IBaseParams;

public class Employee  implements Serializable, IBaseParams {
    private static Employee employee;
    private String accessToken; // token
    private String account; // 登录账号
    private long companyId; //       公司Id
    private String createdAt; //       "": "",
    private int deleted; //       "": 0,
    private long id; //       "": 0,
    private long intDepId; //       "": 0,
    private int intJobStatus; //       "": 0,
    private long intTheatreId;//        "": 0,
    private int isSuperUser;//        "": 0,
    private String lastLoginTime;//        "": "",
    private int loginCount;//        "": 0,
    private String mobile;//       "": "",
    private String name;//        "": "",
    private String password;//        "": "",
    private long roleId;//        "": 0,
    private String roleName;//        "": "",
    private String salt;//        "": "",
    private long stadiumId;//        "": 0,
    private int status;//        "": 0,
    private String statusMsg;//        "": "",
    private String strJobNo;//        "": 0,
    private String strSupJobNo;//        "": 0,
    private String strTheatreName;//        "": "",
    private String updatedAt;//        "": "",
    private String userNo;//        "": "",
    private int version;//
    public static Employee getInstance(){
        if (employee ==null){
            employee = new Employee();
        }
        return employee;
    }
    public static void setInstance(Employee employee){
        Employee.employee = employee;
    }
    private Employee() {
    }

    public Employee(String accessToken, String account, long companyId, String createdAt, int deleted, long id, long intDepId, int intJobStatus, long intTheatreId, int isSuperUser, String lastLoginTime, int loginCount, String mobile, String name, String password, long roleId, String roleName, String salt, long stadiumId, int status, String statusMsg, String strJobNo, String strSupJobNo, String strTheatreName, String updatedAt, String userNo, int version) {
        this.accessToken = accessToken;
        this.account = account;
        this.companyId = companyId;
        this.createdAt = createdAt;
        this.deleted = deleted;
        this.id = id;
        this.intDepId = intDepId;
        this.intJobStatus = intJobStatus;
        this.intTheatreId = intTheatreId;
        this.isSuperUser = isSuperUser;
        this.lastLoginTime = lastLoginTime;
        this.loginCount = loginCount;
        this.mobile = mobile;
        this.name = name;
        this.password = password;
        this.roleId = roleId;
        this.roleName = roleName;
        this.salt = salt;
        this.stadiumId = stadiumId;
        this.status = status;
        this.statusMsg = statusMsg;
        this.strJobNo = strJobNo;
        this.strSupJobNo = strSupJobNo;
        this.strTheatreName = strTheatreName;
        this.updatedAt = updatedAt;
        this.userNo = userNo;
        this.version = version;
    }

    public static Employee getEmployee() {
        return employee;
    }

    public static void setEmployee(Employee employee) {
        Employee.employee = employee;
    }

    public String getAccessToken() {
        return accessToken;
    }

    public void setAccessToken(String accessToken) {
        this.accessToken = accessToken;
    }

    public String getAccount() {
        return account;
    }

    public void setAccount(String account) {
        this.account = account;
    }

    public long getCompanyId() {
        return companyId;
    }

    public void setCompanyId(long companyId) {
        this.companyId = companyId;
    }

    public String getCreatedAt() {
        return createdAt;
    }

    public void setCreatedAt(String createdAt) {
        this.createdAt = createdAt;
    }

    public int getDeleted() {
        return deleted;
    }

    public void setDeleted(int deleted) {
        this.deleted = deleted;
    }

    public long getId() {
        return id;
    }

    public void setId(long id) {
        this.id = id;
    }

    public long getIntDepId() {
        return intDepId;
    }

    public void setIntDepId(long intDepId) {
        this.intDepId = intDepId;
    }

    public int getIntJobStatus() {
        return intJobStatus;
    }

    public void setIntJobStatus(int intJobStatus) {
        this.intJobStatus = intJobStatus;
    }

    public long getIntTheatreId() {
        return intTheatreId;
    }

    public void setIntTheatreId(long intTheatreId) {
        this.intTheatreId = intTheatreId;
    }

    public int getIsSuperUser() {
        return isSuperUser;
    }

    public void setIsSuperUser(int isSuperUser) {
        this.isSuperUser = isSuperUser;
    }

    public String getLastLoginTime() {
        return lastLoginTime;
    }

    public void setLastLoginTime(String lastLoginTime) {
        this.lastLoginTime = lastLoginTime;
    }

    public int getLoginCount() {
        return loginCount;
    }

    public void setLoginCount(int loginCount) {
        this.loginCount = loginCount;
    }

    public String getMobile() {
        return mobile;
    }

    public void setMobile(String mobile) {
        this.mobile = mobile;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getPassword() {
        return password;
    }

    public void setPassword(String password) {
        this.password = password;
    }

    public long getRoleId() {
        return roleId;
    }

    public void setRoleId(long roleId) {
        this.roleId = roleId;
    }

    public String getRoleName() {
        return roleName;
    }

    public void setRoleName(String roleName) {
        this.roleName = roleName;
    }

    public String getSalt() {
        return salt;
    }

    public void setSalt(String salt) {
        this.salt = salt;
    }

    public long getStadiumId() {
        return stadiumId;
    }

    public void setStadiumId(long stadiumId) {
        this.stadiumId = stadiumId;
    }

    public int getStatus() {
        return status;
    }

    public void setStatus(int status) {
        this.status = status;
    }

    public String getStatusMsg() {
        return statusMsg;
    }

    public void setStatusMsg(String statusMsg) {
        this.statusMsg = statusMsg;
    }

    public String getStrJobNo() {
        return strJobNo;
    }

    public void setStrJobNo(String strJobNo) {
        this.strJobNo = strJobNo;
    }

    public String getStrSupJobNo() {
        return strSupJobNo;
    }

    public void setStrSupJobNo(String strSupJobNo) {
        this.strSupJobNo = strSupJobNo;
    }

    public String getStrTheatreName() {
        return strTheatreName;
    }

    public void setStrTheatreName(String strTheatreName) {
        this.strTheatreName = strTheatreName;
    }

    public String getUpdatedAt() {
        return updatedAt;
    }

    public void setUpdatedAt(String updatedAt) {
        this.updatedAt = updatedAt;
    }

    public String getUserNo() {
        return userNo;
    }

    public void setUserNo(String userNo) {
        this.userNo = userNo;
    }

    public int getVersion() {
        return version;
    }

    public void setVersion(int version) {
        this.version = version;
    }

    @Override
    public String toString() {
        return "Employee{" +
                "accessToken='" + accessToken + '\'' +
                ", account='" + account + '\'' +
                ", companyId=" + companyId +
                ", createdAt='" + createdAt + '\'' +
                ", deleted=" + deleted +
                ", id=" + id +
                ", intDepId=" + intDepId +
                ", intJobStatus=" + intJobStatus +
                ", intTheatreId=" + intTheatreId +
                ", isSuperUser=" + isSuperUser +
                ", lastLoginTime='" + lastLoginTime + '\'' +
                ", loginCount=" + loginCount +
                ", mobile='" + mobile + '\'' +
                ", name='" + name + '\'' +
                ", password='" + password + '\'' +
                ", roleId=" + roleId +
                ", roleName='" + roleName + '\'' +
                ", salt='" + salt + '\'' +
                ", stadiumId=" + stadiumId +
                ", status=" + status +
                ", statusMsg='" + statusMsg + '\'' +
                ", strJobNo='" + strJobNo + '\'' +
                ", strSupJobNo='" + strSupJobNo + '\'' +
                ", strTheatreName='" + strTheatreName + '\'' +
                ", updatedAt='" + updatedAt + '\'' +
                ", userNo='" + userNo + '\'' +
                ", version=" + version +
                '}';
    }

    @Override
    public void initParams(JSONObject data) {
        this.accessToken = data.getString("accessToken") ; //
        this.account = data.getString("account") ; //;
        this.companyId = data.getLongValue("companyId") ; //;
        this.createdAt = data.getString("createdAt") ; //;
        this.deleted = data.getIntValue("deleted") ; //;
        this.id = data.getLongValue("id") ; //;
        this.intDepId = data.getLongValue("intDepId") ; //;
        this.intJobStatus = data.getIntValue("intJobStatus") ; //;
        this.intTheatreId = data.getLongValue("intTheatreId") ; //;
        this.isSuperUser = data.getIntValue("isSuperUser") ; //;
        this.lastLoginTime = data.getString("lastLoginTime") ; //;
        this.loginCount = data.getIntValue("loginCount") ; //;
        this.mobile = data.getString("mobile") ; //;
        this.name = data.getString("name") ; //;
        this.password = data.getString("password") ; //;
        this.roleId = data.getLongValue("roleId") ; //;
        this.roleName = data.getString("roleName") ; //;
        this.salt = data.getString("salt") ; //;
        this.stadiumId = data.getLongValue("stadiumId") ; //;
        this.status = data.getIntValue("status") ; //;
        this.statusMsg = data.getString("statusMsg") ; //;
        this.strJobNo = data.getString("strJobNo") ; //;
        this.strSupJobNo = data.getString("strSupJobNo") ; //;
        this.strTheatreName = data.getString("strTheatreName") ; //;
        this.updatedAt = data.getString("updatedAt") ; //;
        this.userNo = data.getString("userNo") ; //;
        this.version = data.getIntValue("version") ; //;
    }
}
